package com.lzc.jobrecomendbackend.controller.recommendation;

import com.lzc.jobrecomendbackend.common.ApiResponse;
import com.lzc.jobrecomendbackend.model.recommendation.CareerAdviceRequest;
import com.lzc.jobrecomendbackend.model.recommendation.CareerAdviceVO;
import com.lzc.jobrecomendbackend.model.recommendation.LearningResourceRequest;
import com.lzc.jobrecomendbackend.model.recommendation.LearningResourceVO;
import com.lzc.jobrecomendbackend.service.recommendation.RecommendationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 智能推荐控制器
 */
@RestController
@RequestMapping("/api/recommendations")
public class RecommendationController {

    @Autowired
    private RecommendationService recommendationService;
    
    /**
     * 获取职业发展建议
     * 
     * @param request 职业建议请求
     * @return 职业建议响应
     */
    @PostMapping("/career-advice")
    public ApiResponse<CareerAdviceVO> getCareerAdvice(@RequestBody CareerAdviceRequest request) {
        CareerAdviceVO result = recommendationService.getCareerAdvice(request);
        return ApiResponse.success(result);
    }
    
    /**
     * 获取学习资源推荐
     * 
     * @param request 学习资源请求
     * @return 学习资源响应
     */
    @PostMapping("/learning-resources")
    public ApiResponse<LearningResourceVO> getLearningResources(@RequestBody LearningResourceRequest request) {
        LearningResourceVO result = recommendationService.getLearningResources(request);
        return ApiResponse.success(result);
    }
} 